package com.fit.pianosheetshop.pages;

import org.apache.tapestry5.annotations.*;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.*;


import com.fit.pianosheetshop.interfaces.*;
import com.fit.pianosheetshop.service.*;


public class ViewPianist {
	@Inject
	@Property
	private Pianists pianists;

	@Property
	private Pianist currentPianist;
	
	@InjectPage
	private EntryBorrow entryBorrow;
	
	@OnEvent(component = "entryPianistLink")
	Object onReaderLink(String name) {
		entryBorrow.setBorrowPianist(name);
		return entryBorrow;
	}
	
	@SessionState
	private User user;

	private boolean userExists;
	
	public User getUser() {
		return user;
	}
	
	Object onActivate() {
		if (!userExists) return Login.class;
		return null;
	}

}
